/**
 * Description: 网络编程相关.
 * <br>传统的方式:
 * <pre>
 *     ServerSocket serverSocket = ...
 *     serverSocket.bind(连接端口号)
 *
 *     while(true) {
 *         Socket socket = serverSocket.accept() // block
 *
 *         new Thread(socket) {
 *             run() {
 *                 socket.getInputStream()
 *                 ...
 *             }
 *         }
 *     }
 *
 *     -----
 *
 *     Socket socket = new Socket(ip, 连接端口号) // 传递数据的端口号与连接端口号的区别: 由服务端根据当前 os 空闲连接的端口与客户端传递数据
 *     socket.connect()
 * </pre>
 *
 * @author LiKe
 * @date 2022-01-21 12:27
 */
package cn.caplike.demo.nio._2021.selector;